var t = getApp();

Component({
    properties: {
        stores: {
            type: null
        },
        loading: {
            type: null
        },
        page: {
            type: null
        },
        totalPage: {
            type: null
        },
        text: {
            type: null
        },
        cityData: {
            type: null
        },
        pointData: {
            type: null
        },
        classifytype: {
            type: null
        },
        is_open: {
            type: null
        },
        noText: {
            type: Boolean,
            value: !1
        },
        listStyle: {
            type: null
        }
    },
    data: {
        language: "",
        list: [],
        show: !1,
        skipshow: !1,
        openTemplate: "01"
    },
    lifetimes: {
        attached: function() {
            var t = wx.getStorageSync("langIndex");
            this.setData({
                language: t.en
            }), this.data.page >= this.data.totalPage ? this.setData({
                show: !1
            }) : this.setData({
                show: !0
            });
        },
        moved: function() {},
        detached: function() {}
    },
    attached: function() {},
    ready: function() {
        this.data.classifytype && 1 == this.data.classifytype && this.setData({
            skipshow: !0
        });
    },
    pageLifetimes: {
        show: function() {},
        hide: function() {},
        resize: function() {}
    },
    methods: {
        toGood: function(t) {
            var e = t.currentTarget.dataset.goods_id;
            wx.navigateTo({
                url: "/packageA/detail_v2/detail_v2?id=" + e
            });
        },
        goToAdress: function(e) {
            var a = e.currentTarget.dataset.items.latitude, o = e.currentTarget.dataset.items.longitude, i = e.currentTarget.dataset.items.store_name, s = t.BMapTransqqMap(parseFloat(o), parseFloat(a));
            wx.openLocation({
                latitude: s.lat,
                longitude: s.lng,
                scale: 18,
                name: i
            });
        },
        toRouter: function(t) {
            var e = t.currentTarget.dataset.items.specify_show, a = t.currentTarget.dataset.items;
            1 == e ? wx.navigateTo({
                url: "/packageC/o2o/o2oStore/o2oStore?store_id=" + a.id
            }) : 1 == a.store_decorate ? wx.navigateTo({
                url: "/packageG/o2o/HomeSeller/HomeSeller?store_id=" + a.id
            }) : wx.navigateTo({
                url: "/packageC/o2o/HomeSeller/HomeSeller?store_id=" + a.id
            });
        },
        toPunch: function(e) {
            var a = e.currentTarget.dataset.id, o = t.getNetAddresss("plugin.store-attendance.frontend.member.attendance");
            t._getNetWork({
                url: o,
                data: {
                    store_id: a
                },
                success: function(t) {
                    var e = t.data;
                    e.result, wx.showToast({
                        title: e.msg,
                        duration: 1e3,
                        icon: "none"
                    });
                },
                fail: function(t) {}
            });
        },
        toClassify: function(t) {
            var e = t.currentTarget.dataset.id, a = t.currentTarget.dataset.name;
            this.data.skipshow ? wx.redirectTo({
                url: "/packageC/o2o/o2oCategory/o2oCategory?id=" + e + "&city=" + this.data.cityData + "&point=" + JSON.stringify(this.data.pointData) + "&name=" + a
            }) : wx.navigateTo({
                url: "/packageC/o2o/o2oCategory/o2oCategory?id=" + e + "&city=" + this.data.cityData + "&point=" + JSON.stringify(this.data.pointData) + "&name=" + a
            });
        },
        gophone: function(t) {
            var e = t.currentTarget.dataset.mobile;
            wx.makePhoneCall({
                phoneNumber: e
            });
        },
        getMoreStores: function() {
            this.triggerEvent("changList");
        }
    },
    observers: {
        totalPage: function() {
            this.data.page >= this.data.totalPage ? this.setData({
                show: !1
            }) : this.setData({
                show: !0
            });
        },
        page: function() {
            this.data.page >= this.data.totalPage ? this.setData({
                show: !1
            }) : this.setData({
                show: !0
            });
        },
        listStyle: function() {
            this.setData({
                openTemplate: 1 == this.data.listStyle ? "02" : "01"
            });
        }
    }
});